home *** CD-ROM | disk | FTP | other *** search
- ;Programm: BangerVersion ist ein kleines Programm um die Version als FileComment zu setzen
- ; Autor: Andre´ Trettin
- ;Codename: Banger
- ; Begin: Dez-94
- ; $VER: BangerVersion.Asm 1.4 (4-Sep-96)
-
- ** INCLUDE Struktur Variablen
- * Fehler Codes: 21=kein Speicher
- * 22=konnte DOS.library nicht öffnen
- * 23=konnte File nicht öffnen
-
- incdir INCLUDE:
- include lvo/dos_lib.i
- include lvo/exec_lib.i
- include dos/dos.i
- include exec/exec.i
-
- STRUCTURE Internal,0
- APTR DOSBase
- APTR TempArray
- APTR CSAArg
- APTR NDAArg
- APTR ONCArg
- APTR ALLArg
- APTR QUIETArg
- APTR RDArgs
- APTR FileListe
- APTR letztesFile
- APTR MyBasisLock
- APTR JetzigeLock
- STRUCT JetzigerFIB,[fib_SIZEOF]
- STRUCT FIBs,[fib_SIZEOF*21]
- STRUCT MyLocks,[4*21]
- STRUCT BufferName,[512]
- WORD DirAnzahl
- *; Unterprog File bearbeitung ****
- APTR FileMem
- APTR FileHandle
- WORD Output2Leer
- STRUCT BufferComment,[88]
- APTR OutputHandle
- WORD Suche1Var
- BYTE Suche2Var
- BYTE Suche3Var
- BYTE Suche4Var
- BYTE Suche5Var
- BYTE Suche6Var
- BYTE SucheJModem
- LABEL Int_SIZEOF
- ;;
- ** Int-Speicher reservieren + dos.lib öffene
- moveq #0,d7
- move.l 4.w,a6
- move.l #Int_SIZEOF,d0
- move.l #MEMF_PUBLIC!MEMF_CLEAR,d1
- jsr _LVOAllocMem(a6)
- move.l d0,a5
- bne.s LibraryOeffnen
- moveq #21,d7 ;21 = kein Speicher
- bra.w Ende
- LibraryOeffnen
- lea dosname(pc),a1
- moveq #37,d0
- jsr _LVOOpenLibrary(a6)
- move.l d0,DOSBase(a5)
- bne.s LibOK
- moveq #22,d7 ;22 = konnte dos.library nicht öffnen
- bra.w IntMemFree
- ;;
- ** Parse Parameter with readarg
- LibOK
- move.l DOSBase(a5),a6
- lea Comtemplate(pc),a1
- move.l a1,d1
- lea TempArray(a5),a1
- move.l a1,d2
- moveq #0,d3
- jsr _LVOReadArgs(a6)
- move.l d0,RDArgs(a5)
- bne.s ParaOK
- bsr.w DOS_Fehler
- bra.w SchliesseLib
- ;;
- ** Filesearch routine
- ParaOK
- move.w #' ',Output2Leer(a5)
- jsr _LVOOutput(a6)
- move.l d0,OutputHandle(a5)
- tst.l QUIETArg(a5)
- bne.s keinWillkommen
- move.l d0,d1
- lea Willkommen(pc),a0
- move.l a0,d2
- move.l #WillkommenEnde-Willkommen,d3
- jsr _LVOWrite(a6)
- keinWillkommen
- ; lea TempPC(pc),a0
- ; move.l a0,TempArray(a5)
- moveq #0,d6
- move.l TempArray(a5),a4
- naechstesTArray
- move.l (a4)+,d1
- beq.w keinFilemehr
- move.l #ACCESS_READ,d2
- jsr _LVOLock(a6)
- move.l d0,MyBasisLock(a5)
- bne.s LockisOK
- bsr.w DOS_Fehler
- bra.w keinFilemehr
- LockisOK
- move.l MyBasisLock(a5),JetzigeLock(a5)
- naechstesDir
- move.l JetzigeLock(a5),d1
- lea JetzigerFIB(a5),a3
- move.l a3,d2
- jsr _LVOExamine(a6)
- tst.l d0
- bne.s ExamineIsOK
- bsr.w DOS_Fehler
- bra.w UnlockMyBasis
- ExamineIsOK
- move.l fib_DirEntryType(a3),d0
- tst.l d0
- bmi.w einFile
- naechstesFile
- move.l JetzigeLock(a5),d1
- lea JetzigerFIB(a5),a3
- move.l a3,d2
- jsr _LVOExNext(a6)
- tst.l d0
- bne.s FileOderDir
- jsr _LVOIoErr(a6)
- cmp.w #ERROR_NO_MORE_ENTRIES,d0
- beq.s JetzigeUnlock
- bsr.w DOS_Fehler
- JetzigeUnlock
- sub.w #1,DirAnzahl(a5)
- move.w DirAnzahl(a5),d5
- tst.w d5
- bmi.w UnlockMyBasis
- move.l JetzigeLock(a5),d1
- jsr _LVOUnLock(a6)
- move.w d5,d1
- asl.w #2,d1
- lea MyLocks(a5),a0
- lea (a0,d1.w),a0
- move.l (a0),JetzigeLock(a5)
- move.w #fib_SIZEOF,d0
- mulu d0,d5
- lea FIBs(a5),a0
- lea (a0,d5.w),a0
- subq #1,d0
- restoreFIB
- move.b (a0)+,(a3)+
- dbra d0,restoreFIB
- bra.s naechstesFile
- FileOderDir
- move.l fib_DirEntryType(a3),d0
- tst.l d0
- bmi.s einFileImDir
- tst.l ALLArg(a5)
- beq.s naechstesFile
- move.w DirAnzahl(a5),d5
- move.w d5,d1
- add.w #1,DirAnzahl(a5)
- asl.w #2,d1
- lea MyLocks(a5),a2
- lea (a2,d1.w),a2
- move.l JetzigeLock(a5),(a2)
- move.l JetzigeLock(a5),d1
- lea BufferName(a5),a2
- move.l a2,d2
- move.l #512,d3
- jsr _LVONameFromLock(a6)
- move.l a2,d1
- lea fib_FileName(a3),a0
- move.l a0,d2
- move.l #512,d3
- jsr _LVOAddPart(a6)
- move.l a2,d1
- move.l #ACCESS_READ,d2
- jsr _LVOLock(a6)
- move.l d0,JetzigeLock(a5)
- move.w #fib_SIZEOF,d0
- mulu d0,d5
- lea FIBs(a5),a0
- lea (a0,d5.w),a0
- subq #1,d0
- copyFIB
- move.b (a3)+,(a0)+
- move.b #0,-1(a3)
- dbra d0,copyFIB
- bra.w naechstesDir
- einFile
- moveq #-1,d6
- einFileImDir
- move.l JetzigeLock(a5),d1
- lea BufferName(a5),a0
- move.l a0,d2
- move.l #512,d3
- jsr _LVONameFromLock(a6)
- move.l d6,letztesFile(a5)
- move.l a4,FileListe(a5)
- bsr.s FileBearbeit
- move.l FileListe(a5),a4
- move.l letztesFile(a5),d6
- tst.l d6
- beq.w naechstesFile
- moveq #0,d6
- UnlockMyBasis
- move.l MyBasisLock(a5),d1
- jsr _LVOUnLock(a6)
- bra.w naechstesTArray
- ;;
- ** FreeArgs
- keinFilemehr
- move.l RDArgs(a5),d1
- jsr _LVOFreeArgs(a6)
- ;;
- ** dos.library schliessen + int speicher freigeben + ende
- SchliesseLib
- move.l 4.w,a6
- move.l DOSBase(a5),a1
- jsr _LVOCloseLibrary(a6)
- IntMemFree
- move.l a5,a1
- move.l #Int_SIZEOF,d0
- jsr _LVOFreeMem(a6)
- Ende
- move.l d7,d0
- rts
- ;;
- ** DOS-Fehler + Ausgabe routine
- DOS_Fehler
- jsr _LVOIoErr(a6)
- move.l d0,d1
- moveq #0,d2
- jsr _LVOPrintFault(a6)
- rts
- ;;
- ** FileBearbeit
- * a3 : FIB-struct
- * a5 : Internal-struct
- * a6 : DOSBase
- FileBearbeit
- tst.l d6
- bmi.s einFileName
- lea BufferName(a5),a0
- move.l a0,d1
- lea fib_FileName(a3),a0
- move.l a0,d2
- move.l #512,d3
- jsr _LVOAddPart(a6)
- einFileName
- move.l 4.w,a6
- move.l fib_Size(a3),d0
- move.l #MEMF_PUBLIC!MEMF_CLEAR,d1
- jsr _LVOAllocMem(a6)
- move.l d0,FileMem(a5)
- bne.s oeffnen
- moveq #21,d7
- bra.s FileSucheEnde
- oeffnen
- move.l DOSBase(a5),a6
- lea BufferName(a5),a0
- move.l a0,d1
- move.l #MODE_OLDFILE,d2
- jsr _LVOOpen(a6)
- move.l d0,FileHandle(a5)
- bne.s lesen
- bra.s DOS_Fehler
- bra.s FileSpeicherFrei
- lesen
- move.l FileHandle(a5),d1
- move.l FileMem(a5),d2
- move.l fib_Size(a3),d3
- jsr _LVORead(a6)
- bsr.s VersionFinden
- moveq #0,d7
- bsr.w CommentAusgabe
- move.l FileHandle(a5),d1
- jsr _LVOClose(a6)
- FileSpeicherFrei
- move.l 4.w,a6
- move.l fib_Size(a3),d0
- move.l FileMem(a5),a1
- jsr _LVOFreeMem(a6)
- FileSucheEnde
- move.l DOSBase(a5),a6
- rts
- ;;
- ** VersionFinden
- VersionFinden
- ** Suche $VER:
- move.b #0,Suche3Var(a5)
- move.b #0,Suche4Var(a5)
- move.b #0,Suche5Var(a5)
- move.b #0,Suche6Var(a5)
- move.b #0,SucheJModem(a5)
- move.l fib_Size(a3),d0
- subq #2,d0
- lea BufferComment(a5),a2
- move.l #0,(a2)
- move.l FileMem(a5),a0
- move.l d0,d3
- swap d3
- sub.w d3,d0
- Suche1Loop
- cmp.b #'$',(a0)+
- beq.s Suche1Erfolg
- dbra d0,Suche1Loop
- dbra d3,Suche1Loop
- bra.w Suche3
- ;;
- ** Suche 1
- Suche1Erfolg
- cmp.w #'VE',(a0)
- bne.s Suche1Loop
- cmp.b #'R',2(a0)
- bne.s Suche1Loop
- lea 4(a0),a0
- moveq #-1,d1
- Suche1Version
- moveq #0,d4
- Zahlen1Testen
- addq #1,d4
- cmp.w #128,d4
- beq.w naechsteSuche
- subq #1,d0
- tst.w d3
- bne.s Ver1testen
- cmp.w #2,d0
- beq.w naechsteSuche
- Ver1testen
- cmp.b #$39,(a0)+ ;Zahlencode 30-39
- bhi.s Zahlen1Testen
- cmp.b #$2F,-1(a0)
- bls.s Zahlen1Testen
- tst.b d1
- beq.s Suche1aErfolg
- bsr.w VersionName
- tst.b d1
- beq.s Zahlen1Testen
- Suche1aErfolg
- move.b -2(a0),d2
- bclr #5,d2
- cmp.b #'V',d2
- beq.s VorVersion1Check
- cmp.b #$20,-2(a0)
- beq.s VorVersion1Check
- cmp.b #'(',-2(a0)
- beq.w VerNr1aEnde
- bra.s Zahlen1Testen
- VorVersion1Check
- cmp.b #$20,(a0)
- beq.s VorVersion2Check
- cmp.b #$2e,(a0)
- beq.s VorVersion2Check
- tst.b Suche6Var(a5)
- beq.s Suche1VorVersiontest
- cmp.b #' ',1(a0)
- beq.s Suche1VorVersiontest
- cmp.b #'.',1(a0)
- beq.s Suche1VorVersiontest
- cmp.b #10,1(a0)
- beq.s Suche1VorVersiontest
- cmp.b #13,1(a0)
- beq.s Suche1VorVersiontest
- cmp.b #$39,1(a0)
- bhi.w Zahlen1Testen
- cmp.b #$2F,1(a0)
- bls.w Zahlen1Testen
- Suche1VorVersiontest
- cmp.b #$39,(a0)
- bhi.w Zahlen1Testen
- cmp.b #$2F,(a0)
- bls.w Zahlen1Testen
- VorVersion2Check
- move.w #'V ',(a2)+
- move.b -1(a0),(a2)+
- VerNr1Loop
- move.b (a0)+,(a2)+
- subq #1,d0
- cmp.b #' ',-1(a2)
- beq.s VerNr1Ende
- cmp.b #'(',-1(a2)
- beq.s VerNr1Leer
- cmp.b #',',-1(a2)
- beq.s VerNr1Leer
- cmp.b #13,-1(a2)
- beq.s VerNr1Leer
- cmp.b #10,-1(a2)
- beq.s VerNr1Leer
- cmp.b #0,-1(a2)
- bne.s VerNr1Loop
- VerNr1Leer
- move.b #' ',-1(a2)
- VerNr1Ende
- tst.l NDAArg(a5)
- bne.w kein1Datum
- move.l a0,a1
- move.w d0,d5
- moveq #0,d4
- Suche1Datum
- addq #1,d4
- cmp.w #128,d4
- beq.w Suche2Datum
- subq #1,d0
- tst.w d3
- bne.s Ver2testen
- tst.w d0
- beq.w Suche2Datum
- Ver2testen
- cmp.b #'(',(a0)+
- bne.s Suche1Datum
- cmp.b #$39,(a0)
- bhi.s Datum2format
- cmp.b #$2F,(a0)
- bls.s Suche1Datum
- cmp.b #$39,1(a0)
- bhi.s Datum1format
- cmp.b #$2F,1(a0)
- bls.s Datum1format
- Datum1Erfolg
- move.b -1(a0),(a2)+
- Datum1Loop
- subq #1,d0
- beq.w Datum1Gefunden
- move.b (a0)+,(a2)+
- cmp.b #')',-1(a2)
- bne.s Datum1Loop
- bra.w Datum1Gefunden
- Datum2format
- move.l a0,d2
- move.b (a0)+,d7
- bclr #5,d7
- cmp.b #'Z',d7
- bhi.s Suche1Datum
- cmp.b #$40,d7
- bls.s Suche1Datum
- bsr.s Buchstabe
- tst.b d1
- beq.s Suche1Datum
- bsr.s Buchstabe
- tst.b d1
- beq.s Suche1Datum
- move.l d2,a0
- bra.s Datum1Erfolg
- Buchstabe
- cmp.b #$7a,(a0)+
- bhi.s Datum2keinB
- cmp.b #$40,-1(a0)
- bls.s Datum2keinB
- moveq #1,d1
- rts
- Datum2keinB
- moveq #0,d1
- rts
- Datum1format
- cmp.b #'.',1(a0)
- beq.s Datum1Erfolg
- cmp.b #'-',1(a0)
- beq.s Datum1Erfolg
- cmp.b #'/',1(a0)
- beq.s Datum1Erfolg
- cmp.b #' ',1(a0)
- beq.s Datum1Erfolg
- cmp.b #':',1(a0)
- beq.s Datum1Erfolg
- bra.w Suche1Datum
- Datumformat
- cmp.b #'.',(a0)
- beq.s DatePunkt
- cmp.b #'-',(a0)
- beq.s DateStrich
- cmp.b #'/',(a0)
- beq.s DateSlash
- cmp.b #' ',(a0)
- beq.s DateLeer
- cmp.b #':',(a0)
- beq.s DateDoppelPunkt
- rts
- DateDoppelPunkt
- move.b #':',d1
- rts
- DatePunkt
- move.b #'.',d1
- rts
- DateStrich
- move.b #'-',d1
- rts
- DateSlash
- move.b #'/',d1
- rts
- DateLeer
- move.b #' ',d1
- rts
- Suche2Datum
- move.l a1,a0
- move.w d5,d0
- moveq #0,d4
- Suche2Loop
- addq #1,d4
- cmp.w #128,d4
- beq.s kein1Datum
- subq #1,d0
- tst.w d3
- bne.s Ver3testen
- tst.w d0
- beq.s kein1Datum
- Ver3testen
- cmp.b #$39,(a0)+
- bhi.s Suche2Loop
- cmp.b #$2F,-1(a0)
- bls.s Suche2Loop
- move.l a0,a1
- moveq #0,d1
- bsr.s Datumformat
- addq #1,a0
- bsr.s Datumformat
- tst.b d1
- beq.s Suche2Loop
- addq #1,a0
- moveq #9,d2
- Suche2aLoop
- cmp.b (a0)+,d1
- beq.s Suche2Monat
- dbra d2,Suche2aLoop
- SucheWieder
- move.l a1,a0
- bra.s Suche2Loop
- Suche2Monat
- cmp.b #$39,(a0)
- bhi.s SucheWieder
- cmp.b #$2F,(a0)
- bls.s SucheWieder
- cmp.b #$39,2(a0)
- bhi.s Jahrende
- cmp.b #$2F,2(a0)
- bls.s Jahrende
- addq #2,a0
- Jahrende
- addq #2,a0
- sub.l a1,a0
- move.l a0,d2
- subq #1,d2
- move.b -1(a1),(a2)+
- Suche2bLoop
- subq #1,d0
- beq.s Datum1Gefunden
- move.b (a1)+,(a2)+
- dbra d2,Suche2bLoop
- Datum1Gefunden
- move.b #' ',(a2)+
- kein1Datum
- rts
- naechsteSuche
- tst.b Suche3Var(a5)
- beq.w Suche3
- bra.w Suche3Fortsetzen
- VerNr1aEnde
- tst.l NDAArg(a5)
- bne.s kein1Datum
- lea -2(a0),a0
- move.w #'V ',(a2)+
- bra.w VerNr1Ende
- ;;
- ** VersionName
- VersionName
- lea fib_FileName(a3),a1
- bsr.s ZahlCheck
- tst.b d1
- beq.s VersionNaKZEnd
- move.l a0,d2
- cmp.b -1(a0),d1
- bne.s VersionNameEnde
- VerZahlLoop
- bsr.s ZahlCheck
- tst.b d1
- beq.s VersionNaVorEnde
- exg a0,a1
- bsr.s ZahlCheck
- tst.b d1
- beq.s VersionNaVorEnde
- exg a0,a1
- cmp.b -1(a1),d1
- beq.s VerZahlLoop
- move.l d2,a0
- VersionNaKZEnd
- moveq #-1,d1
- rts
- VersionNaVorEnde
- moveq #0,d1
- VersionNameEnde
- rts
- ;;
- ** ZahlCheck
- ZahlCheck
- move.b (a1)+,d1
- cmp.b #0,d1
- beq.s ZahlCheckEnde
- cmp.b #$39,d1
- bhi.s ZahlCheck
- cmp.b #$2F,d1
- bls.s ZahlCheck
- ZahlCheckEnde
- rts
- ;;
- ** InitSuche
- InitSuche
- move.l fib_Size(a3),d0
- subq #2,d0
- move.l d0,d3
- swap d3
- sub.w d3,d0
- lea fib_FileName(a3),a1
- move.b (a1),d1
- bclr #5,d1
- move.b d1,Suche2Var(a5)
- move.l a1,a0
- FileName3Loop
- cmp.b #0,(a1)+
- beq.s FileName3Ende
- cmp.b -1(a1),d2
- bne.s FileName3Loop
- FileName3Ende
- sub.l a0,a1
- move.w a1,d2
- subq #3,d2
- move.w d2,Suche1Var(a5)
- move.l FileMem(a5),a0
- rts
- ;;
- ** Suche3
- Suche3
- move.b #1,Suche3Var(a5)
- moveq #0,d2
- bsr.s InitSuche
- Suche3Fortsetzen
- move.b Suche2Var(a5),d1
- Suche3Loop
- move.b (a0)+,d2
- bclr #5,d2
- cmp.b d1,d2
- beq.s Suche3Erfolg
- dbra d0,Suche3Loop
- dbra d3,Suche3Loop
- bra.w SuchMisErfolg
- Suche3Erfolg
- lea fib_FileName(a3),a1
- lea 1(a1),a1
- move.l a0,d4
- move.w d0,d5
- move.w Suche1Var(a5),d2
- Suche3aLoop
- subq #1,d0
- beq.w SuchMisErfolg
- move.b (a0)+,d7
- bclr #5,d7
- move.b (a1)+,d6
- bclr #5,d6
- cmp.b d6,d7
- bne.s nicht2Erfolg
- dbra d2,Suche3aLoop
- moveq #0,d1
- tst.b Suche6Var(a5)
- beq.s Suche3normal
- move.l fib_Size(a3),d4
- move.w d3,d1
- swap d1
- move.w d0,d1
- addq #3,d1
- sub.l d1,d4
- cmp.w #127,d4
- bhi.s halbesB
- lea (a0,d4.w),a0
- bra.w Zahlen1Testen
- halbesB
- lea -128(a0),a0
- Suche3normal
- bra.w Suche1Version
- nicht2Erfolg
- move.l d4,a0
- move.w d5,d0
- bra.s Suche3Loop
- ;;
- ** Suche4
- Suche4
- move.b #1,Suche4Var(a5)
- moveq #'.',d2
- bsr.w InitSuche
- bra.w Suche3Fortsetzen
- ;;
- ** Suche5
- * sucht nach "VERSION"
- Suche5
- move.b #1,Suche5Var(a5)
- lea VersionStr(pc),a4
- move.b #'V',d7
- moveq #5,d6
- Suche5extern
- move.l fib_Size(a3),d0
- subq #2,d0
- move.l d0,d3
- swap d3
- sub.w d3,d0
- move.l FileMem(a5),a0
- Suche5Loop
- move.b (a0)+,d1
- bclr #5,d1
- cmp.b d7,d1
- beq.s Suche5Erfolg
- dbra d0,Suche5Loop
- dbra d3,Suche5Loop
- bra.s SuchMisErfolg
- Suche5Erfolg
- move.l a4,a1
- move.l a0,d4
- move.w d6,d2
- Suche5aLoop
- move.b (a0)+,d1
- bclr #5,d1
- cmp.b (a1)+,d1
- bne.s Suche5Miss
- dbra d2,Suche5aLoop
- moveq #128-16,d4
- bra.w Zahlen1Testen
- Suche5Miss
- move.l d4,a0
- bra.s Suche5Loop
- ;;
- ** Suche6
- Suche6
- move.b #1,Suche6Var(a5)
- bra.w Suche3
- ;;
- ** FileNameJModem
- FileNameJModem
- move.b #1,SucheJModem(a5)
- lea JModemStr(pc),a4
- move.b #'J',d7
- moveq #4,d6
- lea fib_FileName(a3),a1
- FileNameJMLoop
- move.b (a1)+,d1
- bclr #5,d1
- cmp.b d7,d1
- beq.s FileNameJMErfolg
- cmp.b #0,d1
- bne.s FileNameJMLoop
- rts
- FileNameJMErfolg
- move.l a4,a0
- move.l a1,d4
- moveq #4,d2
- FileNameJM2Loop
- move.b (a1)+,d1
- bclr #5,d1
- cmp.b (a0)+,d1
- bne.s FileNameJMMiss
- dbra d2,FileNameJM2Loop
- bra.w Suche5extern
- FileNameJMMiss
- move.l d4,a0
- bra.s FileNameJMLoop
- ;;
- ** SuchMisErfolg
- SuchMisErfolg
- tst.b Suche4Var(a5)
- beq.w Suche4
- tst.b Suche5Var(a5)
- beq.w Suche5
- tst.b Suche6Var(a5)
- beq.s Suche6
- tst.b SucheJModem(a5)
- beq.s FileNameJModem
- rts
- ;;
- ;;
- ** Comment Bearbeitung + Schreiben + Ausgabe
- CommentAusgabe
- tst.l ONCArg(a5)
- bne.w keinCommSA
- lea fib_Comment(a3),a1
- lea NichtMoeglich(pc),a0
- moveq #2,d1
- nichtmLoop
- move.l (a1)+,d0
- cmp.l (a0)+,d0
- bne.s VersionErkennen
- dbra d1,nichtmLoop
- bra.w keinCommSA
- VersionErkennen
- lea BufferComment(a5),a1
- move.l a1,a0
- sub.l a2,a1
- move.l a1,d0
- neg.l d0
- lea fib_Comment(a3),a1
- tst.b (a1)
- bne.s einComment
- cmp.l a2,a0
- beq.w QuietTest
- move.b #0,-1(a2)
- bra.w VComent
- alteDate2Loop
- cmp.b #')',(a1)+
- bne.s alteDate2Loop
- lea 1(a1),a1
- bra.s keineVersComment
- Leer2Stellen
- lea 4(a1),a1
- Leer2Loop
- cmp.b #' ',(a1)+
- bne.s Leer2Loop
- Leer2aLoop
- cmp.b #' ',(a1)+
- beq.s keineVersComment
- cmp.b #0,-1(a1)
- bne.s Leer2aLoop
- bra.s keineVersComment
- einComment
- cmp.w #'V ',(a1)
- bne.s keineVersComment
- tst.l (a0)
- beq.s keineVersComment
- lea 2(a1),a1 ;FileKommentar
- lea 2(a0),a0 ;VersionsNummer
- cmp.b #'(',(a1)
- beq.s alteDate2Loop
- move.b (a1),d1
- cmp.b (a0),d1
- bne.s keineVersComment
- alteVerLoop
- cmp.b #' ',(a1)+
- beq.s DateComment
- cmp.b #0,-1(a1)
- bne.s alteVerLoop
- DateComment
- tst.l NDAArg(a5)
- bne.s keineVersComment
- cmp.b #'(',(a1)
- beq.s alteDate2Loop
- cmp.b #$39,(a1)
- bhi.s keineVersComment
- cmp.b #$2f,(a1)
- bls.s keineVersComment
- cmp.b #' ',1(a1)
- beq.s Leer2Stellen
- cmp.b #' ',2(a1)
- beq.s Leer2Stellen
- alteDateLoop
- cmp.b #' ',(a1)+
- beq.s keineVersComment
- cmp.b #0,-1(a1)
- bne.s alteDateLoop
- keineVersComment
- tst.b (a1)
- bne.s ein2Comment
- move.b #0,-1(a2)
- ein2Comment
- tst.l CSAArg(a5)
- beq.s Comment1Loop
- move.l a1,a0
- WoIstDieNull
- tst.b (a0)+
- bne.s WoIstDieNull
- sub.l a1,a0
- moveq #79,d1
- sub.w a0,d1
- addq #1,d1
- cmp.w d1,d0
- bls.s Indexsetzen
- move.l d1,d0
- Indexsetzen
- lea BufferComment(a5),a2
- lea (a2,d0.w),a2
- Comment1Loop
- move.b (a1)+,(a2)+
- addq #1,d0
- cmp.b #79,d0
- bne.s Comment1Loop
- VComent
- lea BufferName(a5),a0
- move.l a0,d1
- lea BufferComment(a5),a0
- move.l a0,d2
- jsr _LVOSetComment(a6)
- tst.l d0
- beq.s QuietTest
- bsr.w DOS_Fehler
- QuietTest
- tst.l QUIETArg(a5)
- bne.s LoescheBuffer
- keinCommSA
- lea fib_FileName(a3),a1
- move.l a1,a0
- WoIstDie2Null
- tst.b (a0)+
- bne.s WoIstDie2Null
- sub.l a1,a0
- move.l a0,d3
- subq #1,d3
- move.l a1,d2
- move.l OutputHandle(a5),d1
- jsr _LVOWrite(a6)
- lea Output2Leer(a5),a1
- move.l a1,a0
- WoIstDie3Null
- tst.b (a0)+
- bne.s WoIstDie3Null
- move.b #10,-1(a0)
- sub.l a1,a0
- move.l a0,d3
- move.l a1,d2
- move.l OutputHandle(a5),d1
- jsr _LVOWrite(a6)
- LoescheBuffer
- lea BufferComment(a5),a0
- moveq #21,d0
- Loesche1Loop
- move.l #0,(a0)+
- dbra d0,Loesche1Loop
- rts
- ;;
- ** Byte Daten
- JModemStr dc.b 'MODEM'
- VersionStr dc.b 'ERSION'
- NichtMoeglich dc.b 'nicht möglic'
- dc.b '$VER: '
- Willkommen dc.b 'BangerVersion 1.4 (4-Sep-96) is Giftware',10
- dc.b 'BangerVersion: Copyright by Andre` Trettin',10
- dc.b 'Duwockskamp 33, 21029 Hamburg, Germany, EMail: tretti-a@rzbt.fh-hamburg.de',10,10
- WillkommenEnde
- Comtemplate dc.b 'FILES/A/M,CSA=COMMENTSAVE/S,NDA=NODATUM/S,ONC=ONLYCON/S,ALL/S,QUIET/S',0
- dosname DOSNAME
- ; even
- ;TempPC dc.l File0,0
- ;File0 dc.b 'RAM:Ver',0
- ;;
-